﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;

namespace ConsoleApplication3
{
    class Program
    {
        static void Main(string[] args)
        {
            string connectionString = "data source =.; Initial Catalog =MyDB_O;Integrated security =True;";
            SqlConnection connection = new SqlConnection(connectionString);

            //  string query = "insert into MyTable(Name, LastName)VALUES ('name1', 'surname')";
            string query = "update MyTable set name = 'new name', lastName = 'new lastName' WHERE id =3;";
            SqlCommand command = new SqlCommand(query, connection);

            connection.Open();
            command.ExecuteNonQuery();
            connection.Close();
        }
    }
}
